package com.morehair.controller.wx;

import com.morehair.bean.bo.admin.CreateGoodsBo;
import com.morehair.bean.bo.wx.CollectionStatusBo;
import com.morehair.bean.vo.admin.BaseRespVo;
import com.morehair.bean.vo.wx.CollectListDataVo;
import com.morehair.bean.vo.wx.CollectionOperationVo;
import com.morehair.service.wx.WxCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: 收藏
 * Date: 2021/6/9
 * Time: 23:12
 * author: zhang wei
 */
@RestController
@RequestMapping("wx/collect")
public class WxCollectController {

    @Autowired
    WxCollectService wxCollectService;

    @RequestMapping("list")
    public BaseRespVo listOfCollect(Integer type,Integer page,Integer size) {
        CollectListDataVo collectListDataVo = wxCollectService.getCollectList(type,page,size);
        return BaseRespVo.ok(collectListDataVo);
    }

    @RequestMapping("addordelete")
    public BaseRespVo addOrDeleterCollect(@RequestBody CollectionStatusBo collectionStatusBo) {
        CollectionOperationVo collectionOperationVo = wxCollectService.addOrDeleterCollect(collectionStatusBo);
        return BaseRespVo.ok(collectionOperationVo);
    }
}
